home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
148_01
/
xasm99.doc
< prev
next >
Wrap
Text File
|
1987-09-26
|
39KB
|
1,022 lines
.pl 70
.op
.he TMS9900/99105 Cross-assembler Rev. 1.0 Page #
TMS9900/99105 Cross-assembler
Rev. 1.0
Derived from the original William C. Colley, III.
M6800 Cross Assembler
by
Alexander Cameron
Written and modified during June 1984.
The Manual Such As It Is.
.pa
.pn 1
.op
...COLUMNWIDTH 65
...MARGINWIDTH 6
...T1
1.1 Format of Cross-assembler Commands
...T2
1.1.1 Command Strings
To run the 9900 cross-assembler, type the
following command line:
A>a99 filename options
filename:
The name of the source input file is
filename.a99, the list can go to filename.l99,
and the hex file can go to filename.h99.
options: See next section.
...T2
1.1.2 Options
The source file comes from the currently
logged disk drive unless it is redirected by
putting the string "sd" in the options field.
s specifies the source file and d is a device
code from the following list:
a, b, c, d Disk drives.
- The currently logged in disk drive.
Lines of input containing errors will always
be output to the console device. If the full
listing is desired, it must be called for by
putting the string "ld" in the options field.
l specifies list file and d is a device code as
per the source file, or one of the following:
x Console device.
y List device.
The hex file will not be output unless called
for as per the list file.
Options must be run together into a single
string with no embedded blanks.
...T2
1.1.3 Examples
A>a99 barf source -- a:barf.a99
list -- none.
hex -- none.
A>a99 barf sblxha source -- b:barf.a99
list -- con:
hex -- a:barf.h99
A>a99 barf ly source -- a:barf.a99
list -- lst:
hex -- none.
A>b:a99 barf sbh- source -- b:barf.a99
list -- none.
hex -- a:barf.h99
...T1
1.2 Format of TMS9900 Cross-assembler Source Files
Lines of source input are terminated with CR/LF
pairs. Internally, the character before the LF
is discarded, so if the CR is missing, the last
character of the line will be eaten up. The
internal line buffer will hold a 120 character
line. This may be changed by altering the
"#define LINLEN 120" statement in xasm99.gbl
and recompiling the cross-assembler. Excess
characters in the line are thrown out.
Lower case letters are converted to upper
case in as few places as possible. They are:
1) In opcodes,
2) In checking for keywords such as NOT, and
3) In command strings.
This means that "not", "NOT", "Not", etc.
are all possible spellings of the logical
inversion operator. This also means that
"foo" and "FOO" are different symbols.
Watch this if you start encountering U errors
of symbols that you "know" you defined.
...T2
1.2.1 Statements
Source files input to the 9900 Cross-assembler
consist of statements of the form:
[label] [opcode] [arguments] [;comments.]
Labels are recognized by their beginning in
column 1. If it doesn't begin there, it is
assumed to be an opcode. Labels are
assigned the current program counter value
unless the line's opcode is "EQU" or "SET".
Opcodes may be either 9900 instruction
mnemonics or pseudo-ops.
The arguments following the opcode will vary
with the opcode. In the case of opcodes such
as "NOP", they may be absent entirely.
Lines terminate with either a CR/LF pair or a
semicolon that is not embedded in a quoted
string. Anything after a semicolon is ignored
by the assembler, but will appear in the
listing. Note that a semicolon in column 1
will make the entire line a comment.
...T2
1.2.2 Symbols
Symbols may be of any length, but only the
first 8 characters are significant. This
may be changed by changing the "#define
SYMLEN 8" statement in a68.gbl and
recompiling the assembler. Note that
this increases the storage required by the
symbol table as each entry in the symbol
table is SYMLEN+2 bytes in length. The
following characters are legal in a
symbol:
A-Z a-z ! & . : ? [ \ ] ^ _ `
{ | } ~ 0-9
Note that symbols may not begin with 0-9 as
this would make them impossible to distinguish
from Intel format numbers.
A special symbol $ is always equal to the
address of the first byte of code generated by
a given line.
...T2
1.2.3 Numeric Constants
Numbers begin with 0-9,%. % leading base
designator represent binary. If the number
begins with 0-9, the assembler looks for one
of the trailing base designators B, O, Q, D,
or H. If the number does not end with one of
these, it is assumed to be decimal. B is the
base designator for binary, O and Q are for
octal, D is for decimal, and H is for
hexidecimal. Trailing base designators and the
hex digits A-F can be in either upper or lower
case. Note that hex numbers that start
with A-F and are specified with the
designator H must have a leading zero added
to keep them from being mistaken for symbols.
For example:
0ff80h evaluate to ff80 hex.
128 and 128d evaluate to 80 hex.
35o, and 35q evaluate to 1d hex.
%0111000 and 0111000b evaluate to 39 hex.